package usi.ch.onto.yago;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class ObjectFileStore 
{
	public void store(Object object, String storefilename)
	
	{
		ObjectOutputStream oStream = null;
		 
		 try 
		 {
			 oStream = new ObjectOutputStream(new FileOutputStream(storefilename));
			 oStream.writeObject(object);
		} 
		 catch (FileNotFoundException fnfex) 
		 	{
			 	fnfex.printStackTrace();
		 	}
		 catch (IOException io) 
		 	{
			 	io.printStackTrace();
		 	}
		finally
			{
				try 
					{
						if(oStream != null)
							{
								oStream.flush();
								oStream.close();
							}
					} 
				catch (IOException ioe) 
				{
					ioe.printStackTrace();
				}
		
			}
	
	}
	
	
}
